<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="white" />
    <title></title>
    <link rel="stylesheet" href="../public/css/weui.css" />
	<link rel="stylesheet" href="../public/css/jquery-weui.css">
    <link rel="stylesheet" href="../public/css/common.css" />
    <link rel="stylesheet" href="css/index.css" />
	<style>
		[v-cloak]{
			display: none;
		}
	</style>
</head>
<body style="background: #FFFFFF;">
<div id="milldetail" v-cloak>
	<div>
		<div style="height: 1.8rem;"></div>
		<div class="public_top_header">
			<a href="javascript:history.back(-1)" class="weui-cell">
				<div class="weui-cell__hd">
					<img src="../public/images/jiantouleft.png" />
				</div>
				<div class="weui-cell__bd">{{milldetail.name}}</div>
			</a>
		</div>
	</div>
	<div class="milldetail">
		<img class="millimg" :src="'..'+milldetail.mill.millPhoto" />
		<div class="detailmsg">
			<div class="weui-cell name">
				<div class="weui-cell__hd">矿机名称:</div>
				<div class="weui-cell__bd">{{milldetail.name}}</div>
				<div class="weui-cell__ft" @click="changeMillName">
					<img src="../public/images/pen.png" />
				</div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">矿机收益:</div>
				<div class="weui-cell__bd">{{milldetail.mill.rate*100}}%</div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">每日算力:</div>
				<div class="weui-cell__bd">{{milldetail.mill.arithmeticStrength}}</div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">算力天数:</div>
				<div class="weui-cell__bd">{{milldetail.mill.daysNum}}&nbsp;<span>天</span></div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">剩余算力天数:</div>
				<div class="weui-cell__bd">{{parseInt(milldetail.hourNum/24)}}&nbsp;<span>天</span>&nbsp;{{parseInt(milldetail.hourNum%24)}}&nbsp;<span>时</span></div>
			</div>
			<div class="weui-cell amount">
				<div class="weui-cell__hd">矿机额度:</div>
				<div class="weui-cell__bd">{{milldetail.money}}<span>云币</span></div>
				<div class="weui-cell__ft" @click="millUpgrade()">升级矿机</div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">购买时间:</div>
				<div class="weui-cell__bd">{{getYear}}<span>&nbsp;年&nbsp;</span>{{getMonth}}&nbsp;<span>月&nbsp;</span>{{getDay}}&nbsp;<span>日&nbsp;</span>{{getTime}}</div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">矿机累计收益:</div>
				<div class="weui-cell__bd">{{milldetail.allincome}}<span>云币</span></div>
			</div>
			<div class="weui-cell">
				<div class="weui-cell__hd">矿机昨日收益:</div>
				<div class="weui-cell__bd">{{milldetail.yesterdayincome}}<span>云币</span></div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript" src="../public/js/jquery-2.1.4.js"></script>
<script src="../public/js/jquery-weui.js"></script>
<script type="text/javascript" src="../public/js/vue.js" ></script>
<script type="text/javascript" src="../public/js/font_size.js" ></script>
<script type="text/javascript" src="../public/js/common.js" ></script>
<script type="text/javascript">
    $(function(){
        var vm = new Vue({
            el:"#milldetail",
            data: {
            	milldetail:{},
				millid:0,
            },
            methods:{
				changeMillName(){
				    location.href="./millname.html?millid="+this.millid;
				},
                millUpgrade(){
				    local.saveData("mymilldetail",{
				        milllimit:this.milldetail.money,
						millid:this.millid
					});
				    location.href="./millupgrade.html"
				},
            },
			computed:{
                getYear(){
                    var date=new Date(this.milldetail.creationTime)
                    return date.getFullYear()
				},
				getMonth(){
                    var date=new Date(this.milldetail.creationTime)
					return date.getMonth();
				},
				getDay(){
                    var date=new Date(this.milldetail.creationTime);
                    return date.getDate()
				},
				getTime(){
                    var date=new Date(this.milldetail.creationTime);
                    return date.toLocaleTimeString()
				}
			},
            created:function(){
                this.millid=getQueryParams(location.href).millid;
                var millid=this.millid;
                AjaxRequest({
                    url:_url+"/money/mill/mymilldetail",
                    data:{
                        millid
                    },
                    load:true,
                    type:"post",
                    success(res){
                        if(isReqSucceed(res)){
							vm.milldetail=res.data;
						}
                    }
                });
            }
        })
    })
</script>
</body>
</html>



